POV-Ray : Newsgroups : povray.beta-test : crash with string writing : crash with string writing Server Time
29 Jul 2024 22:31:30 EDT (-0400)
  crash with string writing  
From:
Date: 27 Feb 2002 06:17:33
Message: <06fp7ucrh0144h951dfoleg82i6nmp7f57@4ax.com>
POV 3.5 b 11 icl on WinNT Sp 6 PII 233 with 128 MB

My following script causes crash at moment of writing script into file (I know
it becouse empty file appear on drive). Any confirmation ?

#include "functions.inc"
#include "math.inc"

#macro Function_To_DF3(Func,FileName,BMin,BMax,Res)
  // corrections of parameters
  #local BMin=BMin+x*0;
  #local BMax=BMax+x*0;
  #local Res=Res+x*0;
  #local Res=<max(1,int(Res.x)),max(1,int(Res.y)),max(1,int(Res.z))>;
  // help variables
  #local Min=<min(BMin.x,BMax.x),min(BMin.y,BMax.y),min(BMin.z,BMax.z)>;
  #local Max=<max(BMin.x,BMax.x),max(BMin.y,BMax.y),max(BMin.z,BMax.z)>;
  #local Size=Max-Min;
  #local Step=Size/(Res-1);
  // temporary function for faster calculations
  #local Mx=Min.x;
  #local My=Min.y;
  #local Mz=Min.z;
  #local Sx=Step.x;
  #local Sy=Step.y;
  #local Sz=Step.z;
  #local f=function{clip(int(255.999*Func(Mx+x*Sx,My+y*Sy,Mz+z*Sz)),0,255)}
  // string creation
  #local S=""; // to do : header creation
  #local X=0;
  #while (X<Res.x)
    #local Y=0;
    #while (Y<Res.y)
      #local Z=0;
      #while (Z<Res.z)
        #local S=concat(S,chr(f(X,Y,Z)));
        #local Z=Z+1;
      #end
      #local Y=Y+1;
    #end
    #local X=X+1;
  #end
  // file creation
  #fopen DF3 FileName write
  #write(DF3,S)
  #fclose DF3
#end

Function_To_DF3(function{pattern{agate}},"temp.df3",-1,1,<10,11,12>)

ABX


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.